package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.system.vo.SysWithdrawRuleRes;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysWithdrawRuleMapper;
import com.ruoyi.system.domain.SysWithdrawRule;
import com.ruoyi.system.service.ISysWithdrawRuleService;
import com.ruoyi.common.core.text.Convert;

/**
 * 商户代付规则Service业务层处理
 *
 * @author Ericcc
 * @date 2021-03-15
 */
@Service
public class SysWithdrawRuleServiceImpl implements ISysWithdrawRuleService
{
    @Autowired
    private SysWithdrawRuleMapper sysWithdrawRuleMapper;

    /**
     * 查询商户代付规则
     *
     * @param withdrawId 商户代付规则ID
     * @return 商户代付规则
     */
    @Override
    public SysWithdrawRule selectSysWithdrawRuleById(Long withdrawId)
    {
        return sysWithdrawRuleMapper.selectSysWithdrawRuleById(withdrawId);
    }

    /**
     * 查询商户代付规则列表
     *
     * @param sysWithdrawRule 商户代付规则
     * @return 商户代付规则
     */
    @Override
    public List<SysWithdrawRule> selectSysWithdrawRuleList(SysWithdrawRule sysWithdrawRule)
    {
        return sysWithdrawRuleMapper.selectSysWithdrawRuleList(sysWithdrawRule);
    }

    /**
     * 新增商户代付规则
     *
     * @param sysWithdrawRule 商户代付规则
     * @return 结果
     */
    @Override
    public int insertSysWithdrawRule(SysWithdrawRule sysWithdrawRule)
    {
        return sysWithdrawRuleMapper.insertSysWithdrawRule(sysWithdrawRule);
    }

    /**
     * 修改商户代付规则
     *
     * @param sysWithdrawRule 商户代付规则
     * @return 结果
     */
    @Override
    public int updateSysWithdrawRule(SysWithdrawRule sysWithdrawRule)
    {
        return sysWithdrawRuleMapper.updateSysWithdrawRule(sysWithdrawRule);
    }

    /**
     * 删除商户代付规则对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSysWithdrawRuleByIds(String ids)
    {
        return sysWithdrawRuleMapper.deleteSysWithdrawRuleByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除商户代付规则信息
     *
     * @param withdrawId 商户代付规则ID
     * @return 结果
     */
    @Override
    public int deleteSysWithdrawRuleById(Long withdrawId)
    {
        return sysWithdrawRuleMapper.deleteSysWithdrawRuleById(withdrawId);
    }

    @Override
    public List<SysWithdrawRuleRes> selectSysWithdrawRuleResList(SysWithdrawRule sysWithdrawRule) {
        return sysWithdrawRuleMapper.selectSysWithdrawRuleResList(sysWithdrawRule);
    }
}
